[btc-hardening][kyoto] migrate to upstream bip157 v0.5.0#488
Merged
0xsiddharthks merged 4 commits intomainfrom Apr 28, 2026
Merged
[btc-hardening][kyoto] migrate to upstream bip157 v0.5.0#4880xsiddharthks merged 4 commits intomainfrom
0xsiddharthks merged 4 commits intomainfrom
Conversation
bmwill
approved these changes
Apr 28, 2026
a78332b to
d95266e
Compare
Replace the 0xsiddharthks/kyoto fork (siddharth/upgrades, rev f2ba601c)
with crates.io bip157 = "0.5.0". All four features the fork carried
landed upstream:
- get_header(height) -> PR #563
- height_of_hash(hash) -> PR #564 (canonical-only semantics)
- whitelist_only() -> PR #565 folded into #567
- hostname trusted peers -> PR #566 (redesigned in review)
Adapt to upstream's API changes:
- DnsPeer removed. Use TrustedPeer::from_hostname(host, port) and the
Builder::add_peer{,s} APIs over TrustedPeer instead of the old
add_dns_peer{,s}.
- Note v0.5.0 consumes hostname peers on use (popped from the
whitelist when first tried, never reinstated). Re-resolution
requires rebuilding the kyoto node, which our connectivity
supervisor already does on consecutive failures.
- broadcast_tx renamed to submit_package(impl Into<Package>). We
pass a Transaction directly via the From<Transaction> for Package
impl, so the call site is a one-line rename with the same return
type (Wtxid).
Requester::height_of_hash now returns None for non-canonical hashes
(canonical-only via #564). The hashi call site already treats Ok(None)
as "block not on canonical chain" so this tightens correctness for
free with no behavior change. Soften the surrounding warn from
"possibly malicious" to acknowledge sync lag and recent reorgs as the
more common explanations.
We also inherit BIP-130 sendheaders, the new/tried peer fallback fix,
the late-CF-header ban fix, plus rescan_from(height), chain_tip(),
peer_info(), and Package::new_one_parent_one_child for future use.
- Promote kyoto/bip157 to [workspace.dependencies] for consistency - Trim doc comments back toward pre-PR style - Tighten the warn! when bitcoind reports a hash kyoto hasn't seen yet
* [kyoto] tighten supervisor restart threshold to 15 failures
d95266e to
0aad2f8
Compare
bip157 v0.5.0 pops hostname trusted peers from the whitelist on use, so a single peer drop ends the kyoto Node task with NoReachablePeers. The event loop kept waiting on now-silent kyoto channels while client_rx accepted deposits, so deposits stalled indefinitely (CI test_large_withdrawal_signature_chunking confirmed only 27/500 over 600s; see kyoto Failed to look up block ... receiver was dropped). Race the event loop against the kyoto JoinHandle so any exit (Ok, NodeError, or panic) routes into the existing rebuild path.
zhouwfang
pushed a commit
that referenced
this pull request
Apr 30, 2026
* [kyoto] migrate to upstream bip157 v0.5.0 Replace the 0xsiddharthks/kyoto fork (siddharth/upgrades, rev f2ba601c) with crates.io bip157 = "0.5.0".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace our kyoto dependency from my fork of the 2140-dev/kyoto repo with the latest official release.